<!DOCTYPE html>
<!--
 * @Author: your name
 * @Date: 2020-11-26 12:59:05
 * @LastEditTime: 2021-03-07 14:50:17
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \relearnJS\perfectCampus\test.html
-->
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>多彩校园登录</title>
    <link rel="icon" href="./drop-water.png">
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            height: 80vh;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        .login {
            margin-top: 10px;
            display: flex;
            flex-direction: column;
            justify-content: space-around;
            align-items: center;
            width: 324px;
            height: 200px;
        }

        .login label {
            display: inline-block;
            padding: 4px 0;
            width: 60px;
            /* text-align: right; */
            font-weight: lighter;
        }

        .login>div {
            display: flex;
        }

        .login>div input,
        .login button {
            width: calc(100% - 60px);
            align-self: flex-end;
            border: 2px solid #ccc;
            border: 1px solid #000;
            padding: 4px 5px;
        }

        .login>div:last-child {
            width: 228px;
            height: 40px;
            font-size: 25px;
            font-weight: bold;
            border: none;
        }

        .login>div:last-child button {
            width: 100%;
            height: 100%;
        }

        .responseData {
            font-size: 20px;
        }
    </style>
</head>

<body>
    <form class="login">
        <h2>多彩校园登录</h2>
        <div class="tel">
            <label for="loginAccount">手机号: </label>
            <input type="text" name="loginAccount" id="loginAccount" value="">
        </div>
        <div class="pwd">
            <label for="loginAccount">密&nbsp;&nbsp;&nbsp;码: </label>
            <input type="text" name="password" id="password" value="">
        </div>
        <div>
            <button id="submitBtn">登录</button>
        </div>
    </form>
    <br>
    <pre class="responseData"></pre>
    <script src="./test.js"></script>
    <!-- <script src="./yx.js"></script> -->
    <script>
        var submitBtn = document.getElementById("submitBtn"),
            responseText = document.querySelector('.responseData')
        defaultTel = '',
            defaultPwd = ''

        submitBtn.onclick = function () {
            var phone = document.getElementById('loginAccount').value || defaultTel
            var pwd = document.getElementById('password').value || defaultPwd
            // console.log(phone,pwd)
            // new Promise.resolve(getUserInfo(phone, pwd))
            //     .then(res => {
            //         console.log(res)
            //     })
            getUserInfo(phone, pwd, responseText)
            return false;
        }
    </script>
</body>

</html>